package com.ty.day3;

/**
 * Created by IntelliJ IDEA.
 * Author : txy
 * Create 2023/10/30 16:46
 */
public class Nine {
    public static void main(String[] args) {
        System.out.print("完数有：");
        for (int i = 1; i <= 1000; i++) {
            int sum = 0;
            for (int j = 1; j <= i / 2; j++) {
                if (i % j == 0) {
                    sum += j;
                }
            }
            if (sum == i) {
                System.out.print(" " + i);
            }
        }
    }
}
